package sp.util.mail;

/**
 * 激活码对象
 * @description: 
 * @author 浮~沉
 * @date 2020年5月14日
 */
public class AccessCode {
	private String activeCode;	//激活码
	private Long expireIn;		//过期时间
	
	public AccessCode(String activeCode, Integer expireIn) {
		this.setActiveCode(activeCode);
		//获得过期的到达时间
		this.expireIn = System.currentTimeMillis() + Integer.valueOf(expireIn)*1000;
	}
	
	public long getExpireIn() {
		return expireIn;
	}
	
	public void setExpireIn(long expireIn) {
		this.expireIn = expireIn;
	}
	
	
	public String getActiveCode() {
		return activeCode;
	}



	public void setActiveCode(String activeCode) {
		this.activeCode = activeCode;
	}
	
	
	/**
	 * 判断是否过期
	 * @return
	 */
	public boolean isExpire(){
		return System.currentTimeMillis()>getExpireIn();
	}



}
